package com.itcast.demoone.kotlin

// 单例类
object SettingsManager {
    // 单例属性
    var darkModeEnabled = false

    // 单例方法
    fun toggleDarkMode() {
        darkModeEnabled = !darkModeEnabled
        println("暗黑模式 ${ if (darkModeEnabled) "已开启" else "已关闭" }")
    }
}

fun main() {
    SettingsManager.toggleDarkMode()
    SettingsManager.toggleDarkMode()
}